package com.senlingspace.web.controller.douyin;

import com.senlingspace.common.core.domain.AjaxResult;
import com.senlingspace.payment.douyin.bean.response.DouyinVerifyTicketResponse;
import com.senlingspace.payment.douyin.service.DouYinTicketService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 抖音券控制器
 */

@Slf4j
@Validated
@AllArgsConstructor
@RestController
@RequestMapping(path = "/douyin/ticket")
public class DouYinTicketController {

    @Autowired
    private final DouYinTicketService douYinTicketService;



    /**
     * 验券 用于系统扫描抖音提供的券码然后进行核销
     */
    @GetMapping(path = "/v1/prepare")
    public AjaxResult prepare(String douyinShortUrl,Long shopId) {
        return douYinTicketService.prepare(douyinShortUrl,shopId);
    }


}
